<h1>Editar Pre Registro</h1>


<%= form_for @cultural_heritage_cultural_heritage_pre_register do |f| %>
  <% if @cultural_heritage_cultural_heritage_pre_register.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@cultural_heritage_cultural_heritage_pre_register.errors.count, "error") %> prohibited this cultural_heritage_cultural_heritage_pre_register from being saved:</h2>

      <ul>
      <% @cultural_heritage_cultural_heritage_pre_register.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="shadow">
        <fieldset id="agrupacion" >
          <legend>Tipo de Pre Registro</legend>

          
          <fieldset class="column-left" >
                 <div class="field">
                  <%#*<p class="two-col"><label>Grupo (*)</label>%>
   <p class="two-col"><label>Grupo (*)</label>
     <%= f.select :group,@cultural_heritage_groups.collect {|t| [t.name,t.id]},{:include_blank=>"Seleccione"} %></p>
             </div>
             </fieldset>

        </fieldset>
  </div>

 <div class="shadow">
   <fieldset id="agrupacion" >
      <legend>Datos Básicos</legend>
           <fieldset class="column-left" >

                            <div class="field">
                              <label>Nombre:</label>
                               <%= f.text_field :name %>
                            </div>
                             <div class="field">
                               <label>Descripción:</label>
                              <%= f.text_area :description %>
                            </div>
              </fieldset>


        <fieldset class="column-right"id="agrupacion" >


          <legend>Foto</legend>
          <div class="field">
             <label>Imagen</label><br />
            <%= f.file_field :avatar %>
              </div>
        </fieldset>
    </fieldset>
      <br />


   <fieldset id="agrupacion">
          <legend>Medidas</legend>
          <fieldset class="column-left">
                <div class="field">
                  <label>Alto:</label>
                    <%= f.text_field :height %> m
                </div>
                <div class="field">
                  <label>Largo:</label>
                    <%= f.text_field :long %> m
                </div>
          </fieldset>
          <fieldset class="column-right">
              <div class="field">
                <label>Ancho:</label>
                  <%= f.text_field :width %> m
              </div>
              <div class="field" id="weight" >
                <label>Peso</label>
                  <%= f.text_field :weight %> kg
              </div>
          </fieldset>
  </fieldset>
  <br />

  <fieldset id="agrupacion">
              <legend> Manejo de Estados</legend>
                   <div class="field">
          <label>Estado de conservacion</label><br />
              <%= f.select :conservationalState,@cultural_heritage_conservational_states.collect {|t| [t.name,t.id]},{:include_blank=>"Seleccione"} %>
            </div>
            <div class="field">
          <label>Estado de Integridad</label><br />
              <%= f.select :integrityState,@cultural_heritage_integrity_states.collect {|t| [t.name,t.id]},{:include_blank=>"Seleccione"} %>
            </div>
  </fieldset>
  <br />


     <fieldset  id="agrupacion">
       <legend> Agrupaciones </legend>
         <fieldset class="column-left">
              <div>
              <label>Sub Grupo (*)</label><br />
                <%= f.select :subGroup, @cultural_heritage_subgroups.collect {|t| [t.name,t.id]}, {:include_blank=>"Seleccione"} %>
                  </div>
                  <div class="field">
                 <label>Tipologia (*)</label><br />
                    <%= f.select :tipology,@cultural_heritage_tipologies.collect {|t| [t.name,t.id]},{:include_blank=>"Seleccione"} %>
                  </div>
                  <div class="field">
                    <label>Tipo de Institucion Cultural(*)</label><br />
                    <%= f.select :typeCulturalInstitution,@cultural_heritage_type_cultural_institutions.collect {|t| [t.name,t.id]},{:include_blank=>"Seleccione"} %>
                  </div>
                  <div class="field">
                  <label>Institucion Cultural (*)</label><br />
                   <%= f.select :culturalInstitution,@lista_instituciones.collect {|t| [t.name,t.id]},{:include_blank=>"Seleccione"} %>
                  </div>
           </fieldset

      <fieldset class="column-right">
           
            <div class="field">
             <label>Periodo(*)</label><br />
              <%= f.select :period,@cultural_heritage_periods.collect {|t| [t.name,t.id]},{:include_blank=>"Seleccione"} %>
            </div>
            <div class="field">
             <label>Cultura:</label><br />
             <%= f.select :culture,@cultural_heritage_cultures.collect {|t| [t.name,t.id]},{:include_blank=>"Seleccione"} %>
         </div>


            <div class="field">
           <label>Estilo (*)</label><br />
              <%= f.select :style,@cultural_heritage_styles.collect {|t| [t.name,t.id]},{:include_blank=>"Seleccione"} %>
            </div>
         </fieldset>
        </fieldset>
  <br />
  <fieldset id="agrupacion">
          <%#*<legend>Autores</legend>%>
           <%#*<div class="field">%>
         <%#*<label>Dueño (*)</label><br />%>
          <%#= f.text_field :owner %>
        <%#*</div>%>
        <%#*<div class="field">%>
          <%#*<label> Autor (*)</label><br />%>
          <%#= f.text_field :author %>
        <%#*</div>%>
     <p><label>Dueño:</label><%= f.select :owner,@people.collect { |t| [t.name,t.id]}, {:include_blank=>"Seleccione"},{:class => 'combobox'} %> </p>
      <p><label>Autor:</label><%= f.select :author,@people.collect { |t| [t.name,t.id]}, {:include_blank=>"Seleccione"},{:class => 'combobox'}%> </p>
 

  </fieldset>
  <br />
  <fieldset id="agrupacion">
      <legend>Datos Adicionales</legend>
      <fieldset class="column-right" >
         <label>Forma:</label><br />
          <%= f.select :shape,@cultural_heritage_shapes.collect {|t| [t.name,t.id]},{:include_blank=>"Seleccione"} %>
      </fieldset>
      <fieldset class="column-left" >
        <div class="field">
          <label>Materiales:</label><br />
            <%= f.text_area :materials %>
        </div>
      </fieldset>
  </fieldset>
  <br />
  <fieldset id="agrupacion">

    <legend>Ubicación o Lugar de Hallazgo</legend>


    <fieldset class="column-left">
    <div class="field">
      <label>Latitud:</label>
        <%= f.text_field :latitude %>
    </div>
    <div class="field">
      <label>Altitud:</label>
        <%= f.text_field :longitude %>
    </div>
    </fieldset>
    <%#*<div id="ub_inmueble">%>
    <fieldset class="column-right">

    <div class="field" id="ub_inmueble">
        <label>Dirección:</label>
        <%= f.text_area :address %>
    </div>

    </fieldset>


   </fieldset>

 </div>
  


<script language="JavaScript">
<!--
function selectChance(val) {

   <%#*selIdx = document.forms[0].marsupials.selectedIndex;%>
   <%#*newSel = document.forms[0].marsupials.options[selIdx].text;%>
   <%#*alert("Selection has changed to: " + newSel);%>

    if (val== 1)
      {
        <%#*si es inmueble%>
        <%#*var el1 = document.getElementById("weight");%>
        <%#*el1.style.display = 'none';%>
        var el2 = document.getElementById("weight");
        el2.style.display = '';

        <%#*var el3 = document.getElementById("ub_inmueble");%>
        <%#*el3.style.display = '';%>
        var el4 = document.getElementById("ub_inmueble");
        el4.style.display = 'none';


       <%#*alert("Selection has changed to  entro1: " + val);%>


      }

    else
      {
        <%#*var el1 = document.getElementById("weight");%>
        <%#*el1.style.display = '';%>
        var el2 = document.getElementById("weight");
        el2.style.display = 'none';
        <%#*var el3 = document.getElementById("ub_inmueble");%>
        <%#*el3.style.display = 'none';%>
        var el4 = document.getElementById("ub_inmueble");
        el4.style.display = '';


         <%#*alert("Selection has changed to  entro2: " + val);%>

      }

}
//-->
</script>



  <%= f.hidden_field :cultural_heritage_pre_register_request_id %>
  <%= hidden_field_tag "pre_register_page",@cultural_heritage_cultural_heritage_pre_register.cultural_heritage_pre_register_request_id %>
  <div class="actions">
     <%= f.submit "Guardar",:class=> 'button', :onclick => "return confirm('¿Está seguro que desea grabar?' )" %>
  </div>
<%= link_to 'Regresar',{:controller => "cultural_heritage/pre_register_requests", :action => "edit",:id => @cultural_heritage_cultural_heritage_pre_register.cultural_heritage_pre_register_request_id  }%>
<% end %>
